package org.utils.cmdline.parameters;

import java.util.Iterator;
import java.util.NoSuchElementException;

public class SingleValueParameter extends NonTerminalParameter {
    
    private String value;

//accessing
    public String value() {
		return value;
    }
    
    public void value(String aValue) {
		value = aValue;	
    }
    
//constants
    public String defaultValue() {
		return "";
    }
    
//action
    public void loadAdditionalArguments(Iterator iterator) {
		super.loadAdditionalArguments(iterator);
		try {
			value((String)iterator.next());
		} catch (NoSuchElementException exception) {
			terminalDealWithException(exception);
		}
    }
    
//construction
    public SingleValueParameter(int additionalParameterLength) {
		super(additionalParameterLength);
		value(defaultValue());
    }
}

